#include <stdio.h>
#define IN	1
#define OUT	0
/*
 * Write a program that prints its input one word per line. 
 */

int iswhite(int);

main(){	
	int lastischar, car;
	int inword = OUT;
	
	while((car = getchar()) != EOF){
		if(!iswhite(car)){
			lastischar = IN;
			if(!inword){
				inword = IN;
			}
			printf("%c", car);
		}else{
			if(lastischar)
				printf("\n");
			inword = OUT;
		}
	}
	printf("\n");
}

int iswhite(int car){
	return ((car == '\t') || (car == '\n') || (car == ' '));
}
